<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	</h:head>
	
	<h:body>


<h:form id="formListaCliente">

			<p:dataTable id="listagemClientes" var="cliente"
				value="#{clienteBean.listaClientes}" rules="groups"
				rendered="#{!empty clienteBean.listaClientes}">

				<f:facet name="header">Clientes Cadastrados</f:facet>
				<f:facet name="footer">Final da Listagem</f:facet>

				<p:column>
					<f:facet name="header">Nome</f:facet>
							#{cliente.nome}
						</p:column>
				
				<p:column>
					<f:facet name="header">CPF</f:facet>
							#{cliente.cpf}
						</p:column>						

				<p:column>
					<f:facet name="header">Endereço</f:facet>
							#{cliente.endereco}
						</p:column>

				<p:column>
					<f:facet name="header">UF</f:facet>
							#{cliente.uf}
						</p:column>

				<p:column style="width:20px">
					<p:commandLink action="#{clienteBean.editar}">
						<p:graphicImage url="/resources/images/Editar.png" />
						<f:setPropertyActionListener target="#{clienteBean.cliente}"
							value="#{cliente}" />
					</p:commandLink>
				</p:column>
				
				<p:column style="width:20px">
					<p:commandLink action="#{clienteBean.excluir}" onclick="if (!confirm('Confirma a exclusão do cliente #{cliente.nome}?')) return false;">
						<p:graphicImage url="/resources/images/Excluir.png" />
						<f:setPropertyActionListener target="#{clienteBean.cliente}"
							value="#{cliente}" />
					</p:commandLink>
				</p:column>
				
			</p:dataTable>
		</h:form>



	</h:body>

</html>